#include <stdio.h>
#include "SumDays.h"
#include "isLeapYear.h"
#include "Week.h"

int Week(int month, int year)
{
	int week = SumDays(year);
//	printf("%d\n",week);
	int leap1[12] = {31,29,31,30,31,30,31,31,30,31,30,31};
	int leap2[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
	int days = 0;
	int i;
	if(isLeapYear(year) > 0)
	{
		for(i = 0;i < month-1;++i)
		{
			days += leap1[i];
		}
	}
	else if(isLeapYear(year) == 0)
	{
		for(i = 0;i < month - 1;++i)
		{
			days += leap2[i];
		}
	}
	days += week;
	return days % 7;
}
